package com.brillilab.dao.mapper.method;


import java.util.List;

import com.brillilab.domain.enums.common.BoolEnum;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.brillilab.domain.pa.method.MethodListPa;
import com.brillilab.domain.po.method.Method;
import com.brillilab.domain.vo.method.MethodContrastChartVo;
import com.brillilab.domain.vo.method.MethodListVo;
import com.brillilab.domain.vo.method.MethodMemberVo;
import com.brillilab.domain.vo.method.MethodReferRecommendVo;
import com.brillilab.domain.vo.method.ReferExportCountVo;

public interface MethodMapper extends BaseMapper<Method> {
    Integer getCurrentVersion(@Param("initMethodId") Long initMethodId);

    /**
     * 获取参考推荐
     *
     * @param userId
     * @param firstId
     * @param secondName
     * @param methodTypeName
     * @return
     */
    List<MethodReferRecommendVo> getMethodReferRecommendList(@Param("userId") Long userId, @Param("firstId") Long firstId, @Param("secondName") String secondName, @Param("methodTypeName") String methodTypeName);

    /**
     * 获取方法列表
     *
     * @param pa
     * @return
     */
    List<MethodListVo> getMethodList(@Param("pa") MethodListPa pa);

    /**
     * 获取图形数据VoList
     *
     * @param labId
     * @param firstTypeIds
     * @return
     */
    List<MethodContrastChartVo> getMethodChartList(@Param("labId") Long labId, @Param("firstTypeIds") List<Long> firstTypeIds);

    /**
     * 获取图形数据VoList
     * @param labId
     * @param firstTypeId
     * @param secondTypeName
     * @param methodTypeName
     * @return
     */
    List<MethodContrastChartVo> getMethodChartInfo(@Param("labId") Long labId, @Param("firstTypeId") Long firstTypeId, 
			@Param("secondTypeName") String secondTypeName, @Param("methodTypeName") String methodTypeName);
    /**
     * 方法库成员列表
     *
     * @param labId
     * @param state 状态:1-正常，2-移出,null-全部
     * @return
     */
    List<MethodMemberVo> getMethodMemberList(@Param("labId") Long labId, @Param("state") Integer state);

    List<Method> listRecommendMethod(@Param("labId") Long labId);

    Integer increaseExportCount(@Param("methodId")Long methodId);
	
    List<ReferExportCountVo> totalExportCount(@Param("methodIds") List<Long> methodIds);

    List<Method> selectCurrentListByMethodTypeIdsAndUserId(@Param("thirdMethodTypeIds") List<Long> thirdMethodTypeIds,
                                                           @Param("userId") Long userId,
                                                           @Param("hasCommonMethod") boolean hasCommonMethod);

    int countCurrentListByMethodTypeIdsAndUserId(@Param("thirdMethodTypeIds") List<Long> thirdMethodTypeIds,
                                                 @Param("userId") Long userId,
                                                 @Param("hasCommonMethod") boolean hasCommonMethod);

    List<Method> getMethodListByUserIdAndState(@Param("userId") Long userId,
                                               @Param("isDelete") BoolEnum isDelete,
                                               @Param("isCurrent") BoolEnum isCurrent,
                                               @Param("hasCommonMethod") boolean hasCommonMethod);

    Integer resetToCurrent(@Param("userId")Long userId,@Param("initMethodId")Long initMethodId);

    int insertBatch(@Param("list") List<Method> methods);

    int updateInitInfo(@Param("list") List<Method> methods);
}
